package cn.com.yx.ms.controller;

import cn.com.yx.ms.service.IStaService;
import cn.yx.framework.configuration.AppConstant;
import cn.yx.framework.view.ApiResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

// import org.java_websocket.drafts.Draft_17;

/**
 * 应用中心
 */
@RestController
@RequestMapping(value = "sta")
@Api(value = "统计接口", description = "统计接口")
public class StaController {

    private static final Logger logger = LoggerFactory.getLogger(StaController.class);

    @Resource
    private IStaService iStaService;

    @GetMapping("chart1")
    @ApiOperation(value = "统计设备基本信息", notes = "统计设备基本信息")
    public ApiResult staChart1() {
        return new ApiResult<>(AppConstant.MSG_SUCCESS, true, "", iStaService.staChart1());
    }

    @GetMapping("command")
    @ApiOperation(value = "上下行指令报表",notes = "上下行指令报表")
    public ApiResult commandTotalCount(){
        return new ApiResult<>(AppConstant.MSG_SUCCESS,true,"",iStaService.staCommand());
    }

    @GetMapping("command3003")
    @ApiOperation(value = "心跳数据实时监控",notes = "心跳数据实时监控")
    public ApiResult command3003Count(){
        return new ApiResult<>(AppConstant.MSG_SUCCESS,true,"",iStaService.staCommand3003());
    }

    @GetMapping("commandTotalDevice")
    @ApiOperation(value = "设备总量",notes = "设备总量")
    public ApiResult commandTotalDevice(){
        return new ApiResult<>(AppConstant.MSG_SUCCESS,true,"",iStaService.staCommandTotalDevice());
    }

    @GetMapping("commandOnLineOffLineDevice")
    @ApiOperation(value = "设备在线离线",notes = "设备在线离线")
    public ApiResult commandOnLineOffLineDevice(){
        return new ApiResult<>(AppConstant.MSG_SUCCESS,true,"",iStaService.commandOnLineOffLineDevice());
    }

    @GetMapping("4gtraffic")
    @ApiOperation(value = "4GTop5",notes = "4GTop5")
    public ApiResult traffic4g(){
        return new ApiResult<>(AppConstant.MSG_SUCCESS,true,"",iStaService.commandTraffic4g());
    }

    @GetMapping("wifitraffic")
    @ApiOperation(value = "WIFITop5",notes = "WIFITop5")
    public ApiResult trafficWifi(){
        return new ApiResult<>(AppConstant.MSG_SUCCESS,true,"",iStaService.commandTrafficWifi());
    }

    @GetMapping("command5003Count")
    @ApiOperation(value="Command5003Count",notes = "Command5003Count")
    public ApiResult command5003Count(){
        return new ApiResult<>(AppConstant.MSG_SUCCESS,true,"",iStaService.staCommand5003());
    }

}